//
//  PersonalCenterMessageTableViewCell.m
//  XingMei
//
//  Created by 姚琪 on 2019/3/25.
//  Copyright © 2019年 钱金军. All rights reserved.
//

#import "PersonalCenterMessageTableViewCell.h"


@interface PersonalCenterMessageTableViewCell ()

@end



@implementation PersonalCenterMessageTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.frame = CGRectMake(0, 0, KScreenWidth, 105);
        _titlelb = [[UILabel alloc] initWithFrame:CGRectMake(15, 15, self.width - 30 - 80 - 10, 13)];
        _titlelb.font = MediumFont(14);
        _titlelb.textColor = rgb(51, 51, 51);
        [self.contentView addSubview:_titlelb];
        
        _content = [[UILabel alloc] initWithFrame:CGRectMake(_titlelb.xv, _titlelb.bottom + 10, self.width - 30 , self.height - _titlelb.bottom - 15 - 10)];
        _content.font = MediumFont(12);
        _content.numberOfLines = 2;
        _content.textColor = rgb(153, 153, 153);
        [self.contentView addSubview:_content];
        
        _time = [[UILabel alloc] initWithFrame:CGRectMake(self.width - 15 - 80, _titlelb.yv, 80,12 )];
        _time.font = MediumFont(11);
        _time.textAlignment = NSTextAlignmentRight;
        _time.textColor = rgb_153;
        [self.contentView addSubview:_time];
    }
    return self;
}
-(void)setDict:(NSDictionary *)dict{
    _dict = dict;
//    _titlelb.text = dict[@"title"];
    _titlelb.text = @"标题代替文字代替文字代替文字";
//    _content.text = dict[@"desc_msg"];
    _content.text = @"具体信息代替文字代替文字代替文字具体信息代替文字代替文字代替文字具体信息代替文字代替文字代替文字具体信息代替文字代替文字代替文字";
    CGFloat sourceHeight = _content.height;
    CGFloat height = [ToolClass getHeightWithTextLabel:_content font:MediumFont(12)];
    if (height > sourceHeight) {
        height = sourceHeight;
    }else{
        height = height;
    }
    _content.height = height;
//    _time.text = dict[@"add_time"];
    _time.text = @"03-05 12:45";
}

@end
